﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SubSonic;

namespace AppBox.admin
{
    public partial class jobtitle_new : PageBase
    {
        private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        #region Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        private void LoadData()
        {
            btnClose.OnClientClick = ExtAspNet.ActiveWindow.GetConfirmHidePostBackReference();

        }

        #endregion

        #region Events

        private void SaveJobTitle()
        {
            XJobTitle item = new XJobTitle();
            item.Name = tbxName.Text.Trim();
            item.Remark = tbxRemark.Text.Trim();

            item.Save(User.Identity.Name);
        }

        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            SaveJobTitle();

            ExtAspNet.Alert.Show("添加成功！", String.Empty, ExtAspNet.ActiveWindow.GetHidePostBackReference());
        }
        #endregion

    }
}
